<!doctype html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="大数据,hive," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.1" />






<meta name="description" content="版权声明:作者：虚无境博客园出处：http://www.cnblogs.com/xuwujingCSDN出处：http://blog.csdn.net/qazwsxpcm　　　　个人博客出处：http://www.panchengming.com原创不易，转载请标明出处，谢谢！ 引言在大数据学习系列之一 —– Hadoop环境搭建(单机) 成功的搭建了Hadoop的环境，在大数据学习系列之二 —">
<meta name="keywords" content="大数据,hive">
<meta property="og:type" content="article">
<meta property="og:title" content="大数据学习系列之四 ----- Hadoop+Hive环境搭建图文详解(单机)">
<meta property="og:url" content="http://yoursite.com/2017/12/16/pancm61/index.html">
<meta property="og:site_name" content="虚无境的博客">
<meta property="og:description" content="版权声明:作者：虚无境博客园出处：http://www.cnblogs.com/xuwujingCSDN出处：http://blog.csdn.net/qazwsxpcm　　　　个人博客出处：http://www.panchengming.com原创不易，转载请标明出处，谢谢！ 引言在大数据学习系列之一 —– Hadoop环境搭建(单机) 成功的搭建了Hadoop的环境，在大数据学习系列之二 —">
<meta property="og:image" content="http://img.blog.csdn.net/20171216091314380?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216091322445?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216091342560?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216091357000?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216091501845?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216091540852?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216091605939?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216091707973?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216091925239?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216092101563?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216092323706?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216092332426?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216092358071?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216092503494?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216092513103?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216092521889?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216092610984?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216092625312?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216092640698?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216092739971?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216092911542?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171216092924498?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:updated_time" content="2017-12-18T12:34:18.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="大数据学习系列之四 ----- Hadoop+Hive环境搭建图文详解(单机)">
<meta name="twitter:description" content="版权声明:作者：虚无境博客园出处：http://www.cnblogs.com/xuwujingCSDN出处：http://blog.csdn.net/qazwsxpcm　　　　个人博客出处：http://www.panchengming.com原创不易，转载请标明出处，谢谢！ 引言在大数据学习系列之一 —– Hadoop环境搭建(单机) 成功的搭建了Hadoop的环境，在大数据学习系列之二 —">
<meta name="twitter:image" content="http://img.blog.csdn.net/20171216091314380?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2017/12/16/pancm61/"/>






  <title>大数据学习系列之四 ----- Hadoop+Hive环境搭建图文详解(单机) | 虚无境的博客</title>
  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?39c177d10f6e05ddfa113e02139b9c1c";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>










</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">虚无境的博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2017/12/16/pancm61/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="虚无境">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/xuwujing.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="虚无境的博客">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">大数据学习系列之四 ----- Hadoop+Hive环境搭建图文详解(单机)</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-12-16T09:32:36+08:00">
                2017-12-16
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/hive/" itemprop="url" rel="index">
                    <span itemprop="name">hive</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    <div class="post-body" itemprop="articleBody">

      
      

      
        <script src="\assets\js\APlayer.min.js"> </script><p>版权声明:<br>作者：虚无境<br>博客园出处：<a href="http://www.cnblogs.com/xuwujing" target="_blank" rel="external">http://www.cnblogs.com/xuwujing</a><br>CSDN出处：<a href="http://blog.csdn.net/qazwsxpcm" target="_blank" rel="external">http://blog.csdn.net/qazwsxpcm</a>　　　　<br>个人博客出处：<a href="http://www.panchengming.com" target="_blank" rel="external">http://www.panchengming.com</a><br>原创不易，转载请标明出处，谢谢！</p>
<h2 id="引言"><a href="#引言" class="headerlink" title="引言"></a>引言</h2><p>在<a href="http://blog.csdn.net/qazwsxpcm/article/details/78637874" target="_blank" rel="external">大数据学习系列之一 —– Hadoop环境搭建(单机)</a> 成功的搭建了Hadoop的环境，在<a href="http://blog.csdn.net/qazwsxpcm/article/details/78760055" target="_blank" rel="external">大数据学习系列之二 —– HBase环境搭建(单机)</a>成功搭建了HBase的环境以及相关使用介绍。本文主要讲解如何搭建Hadoop+Hive的环境。</p>
<h2 id="一、环境准备"><a href="#一、环境准备" class="headerlink" title="一、环境准备"></a>一、环境准备</h2><h3 id="1，服务器选择"><a href="#1，服务器选择" class="headerlink" title="1，服务器选择"></a>1，服务器选择</h3><p>本地虚拟机<br>操作系统:linux  CentOS 7<br>Cpu：2核<br>内存：2G<br>硬盘:40G</p>
<p><strong>说明</strong>:因为使用阿里云服务器每次都要重新配置，而且还要考虑网络传输问题，于是<a href="http://blog.csdn.net/qazwsxpcm/article/details/78816230" target="_blank" rel="external">自己在本地便搭建了一个虚拟机</a>，方便文件的传输以及相关配置，缺点是本来卡的电脑就变得更卡了。具体教程和使用在上一遍博文中。<br>地址: <a href="http://blog.csdn.net/qazwsxpcm/article/details/78816230。" target="_blank" rel="external">http://blog.csdn.net/qazwsxpcm/article/details/78816230。</a></p>
<h3 id="2，配置选择"><a href="#2，配置选择" class="headerlink" title="2，配置选择"></a>2，配置选择</h3><p>JDK:1.8          （jdk-8u144-linux-x64.tar.gz）<br>Hadoop:2.8.2  (hadoop-2.8.2.tar.gz)<br>Hive： 2.1   (apache-hive-2.1.1-bin.tar.gz)</p>
<h3 id="3，下载地址"><a href="#3，下载地址" class="headerlink" title="3，下载地址"></a>3，下载地址</h3><p>JDK：<br><a href="http://www.oracle.com/technetwork/java/javase/downloads" target="_blank" rel="external">http://www.oracle.com/technetwork/java/javase/downloads</a><br>Hadopp:<br><a href="http://www.apache.org/dyn/closer.cgi/hadoop/common" target="_blank" rel="external">http://www.apache.org/dyn/closer.cgi/hadoop/common</a><br> Hive<br><a href="http://mirror.bit.edu.cn/apache/hive/" target="_blank" rel="external">http://mirror.bit.edu.cn/apache/hive/</a></p>
<p>百度云盘:<br>链接：<a href="https://pan.baidu.com/s/1slxBsHv" target="_blank" rel="external">https://pan.baidu.com/s/1slxBsHv</a> 密码：x51i</p>
<h2 id="二、服务器的相关配置"><a href="#二、服务器的相关配置" class="headerlink" title="二、服务器的相关配置"></a>二、服务器的相关配置</h2><p>   在配置Hadoop+Hive之前，应该先做一下配置。<br>  做这些配置为了方便，使用root权限。</p>
<h3 id="1，更改主机名"><a href="#1，更改主机名" class="headerlink" title="1，更改主机名"></a>1，更改主机名</h3><p>首先更改主机名，目的是为了方便管理。<br>输入: </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hostname</div></pre></td></tr></table></figure>
<p>查看本机的名称<br>然后更改主机名为master<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hostnamectl set-hostname master</div></pre></td></tr></table></figure>
<p><strong>注:主机名称更改之后，要重启(reboot)才会生效。</strong></p>
<h3 id="2，做IP和主机名的映射"><a href="#2，做IP和主机名的映射" class="headerlink" title="2，做IP和主机名的映射"></a>2，做IP和主机名的映射</h3><p>修改hosts文件，做关系映射<br>输入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vim /etc/hosts</div></pre></td></tr></table></figure>
<p>添加<br>主机的ip 和 主机名称</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">192.168.238.128 master</div></pre></td></tr></table></figure>
<h3 id="3，关闭防火墙"><a href="#3，关闭防火墙" class="headerlink" title="3，关闭防火墙"></a>3，关闭防火墙</h3><p>关闭防火墙，方便访问。<br><strong>CentOS 7版本以下输入:</strong><br>关闭防火墙</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">service   iptables stop</div></pre></td></tr></table></figure>
<p><strong>CentOS 7 以上的版本输入：</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">systemctl stop firewalld.service</div></pre></td></tr></table></figure>
<h3 id="3，时间设置"><a href="#3，时间设置" class="headerlink" title="3，时间设置"></a>3，时间设置</h3><p>查看当前时间<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">date</div></pre></td></tr></table></figure>
<p>查看服务器时间是否一致，若不一致则更改<br>更改时间命令</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">date -s ‘MMDDhhmmYYYY.ss’</div></pre></td></tr></table></figure>
<h2 id="三、Hadoop安装和配置"><a href="#三、Hadoop安装和配置" class="headerlink" title="三、Hadoop安装和配置"></a>三、Hadoop安装和配置</h2><p>Hadoop的具体配置在<a href="http://blog.csdn.net/qazwsxpcm/article/details/78637874" target="_blank" rel="external">大数据学习系列之一 —– Hadoop环境搭建(单机)</a> 中介绍得很详细了。所以本文就大体介绍一下。<br><strong>注:具体配置以自己的为准。</strong></p>
<h3 id="1，环境变量设置"><a href="#1，环境变量设置" class="headerlink" title="1，环境变量设置"></a>1，环境变量设置</h3><p>编辑 /etc/profile 文件 :<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vim /etc/profile</div></pre></td></tr></table></figure></p>
<p>配置文件:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">export HADOOP_HOME=/opt/hadoop/hadoop2.8</div><div class="line">export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native</div><div class="line">export HADOOP_OPTS=&quot;-Djava.library.path=$HADOOP_HOME/lib&quot;</div><div class="line">export PATH=.:$&#123;JAVA_HOME&#125;/bin:$&#123;HADOOP_HOME&#125;/bin:$PATH</div></pre></td></tr></table></figure>
<h3 id="2，配置文件更改"><a href="#2，配置文件更改" class="headerlink" title="2，配置文件更改"></a>2，配置文件更改</h3><p>先切换到 /home/hadoop/hadoop2.8/etc/hadoop/ 目录下</p>
<h4 id="3-2-1-修改-core-site-xml"><a href="#3-2-1-修改-core-site-xml" class="headerlink" title="3.2.1 修改 core-site.xml"></a>3.2.1 修改 core-site.xml</h4><p>输入:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vim core-site.xml</div></pre></td></tr></table></figure></p>
<p>在<configuration>添加:</configuration></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div></pre></td><td class="code"><pre><div class="line">&lt;configuration&gt;</div><div class="line">&lt;property&gt;</div><div class="line">        &lt;name&gt;hadoop.tmp.dir&lt;/name&gt;</div><div class="line">        &lt;value&gt;/root/hadoop/tmp&lt;/value&gt;</div><div class="line">        &lt;description&gt;Abase for other temporary directories.&lt;/description&gt;</div><div class="line">   &lt;/property&gt;</div><div class="line">   &lt;property&gt;</div><div class="line">        &lt;name&gt;fs.default.name&lt;/name&gt;</div><div class="line">        &lt;value&gt;hdfs://master:9000&lt;/value&gt;</div><div class="line">   &lt;/property&gt;</div><div class="line">&lt;/configuration&gt;</div></pre></td></tr></table></figure>
<h3 id="3-2-2修改-hadoop-env-sh"><a href="#3-2-2修改-hadoop-env-sh" class="headerlink" title="3.2.2修改 hadoop-env.sh"></a>3.2.2修改 hadoop-env.sh</h3><p>输入:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vim hadoop-env.sh</div></pre></td></tr></table></figure></p>
<p>将${JAVA_HOME} 修改为自己的JDK路径<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">export   JAVA_HOME=$&#123;JAVA_HOME&#125;</div></pre></td></tr></table></figure></p>
<p>修改为：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">export   JAVA_HOME=/home/java/jdk1.8</div></pre></td></tr></table></figure>
<h3 id="3-2-3修改-hdfs-site-xml"><a href="#3-2-3修改-hdfs-site-xml" class="headerlink" title="3.2.3修改 hdfs-site.xml"></a>3.2.3修改 hdfs-site.xml</h3><p>输入:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vim hdfs-site.xml</div></pre></td></tr></table></figure></p>
<p>在<configuration>添加:</configuration></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div></pre></td><td class="code"><pre><div class="line">&lt;property&gt;</div><div class="line">   &lt;name&gt;dfs.name.dir&lt;/name&gt;</div><div class="line">   &lt;value&gt;/root/hadoop/dfs/name&lt;/value&gt;</div><div class="line">   &lt;description&gt;Path on the local filesystem where theNameNode stores the namespace and transactions logs persistently.&lt;/description&gt;</div><div class="line">&lt;/property&gt;</div><div class="line">&lt;property&gt;</div><div class="line">   &lt;name&gt;dfs.data.dir&lt;/name&gt;</div><div class="line">   &lt;value&gt;/root/hadoop/dfs/data&lt;/value&gt;</div><div class="line">   &lt;description&gt;Comma separated list of paths on the localfilesystem of a DataNode where it should store its blocks.&lt;/description&gt;</div><div class="line">&lt;/property&gt;</div><div class="line">&lt;property&gt;</div><div class="line">   &lt;name&gt;dfs.replication&lt;/name&gt;</div><div class="line">   &lt;value&gt;2&lt;/value&gt;</div><div class="line">&lt;/property&gt;</div><div class="line">&lt;property&gt;</div><div class="line">      &lt;name&gt;dfs.permissions&lt;/name&gt;</div><div class="line">      &lt;value&gt;false&lt;/value&gt;</div><div class="line">      &lt;description&gt;need not permissions&lt;/description&gt;</div><div class="line">&lt;/property&gt;</div></pre></td></tr></table></figure>
<h3 id="3-2-4-修改mapred-site-xml"><a href="#3-2-4-修改mapred-site-xml" class="headerlink" title="3.2.4 修改mapred-site.xml"></a>3.2.4 修改mapred-site.xml</h3><p>如果没有 mapred-site.xml 该文件，就复制mapred-site.xml.template文件并重命名为mapred-site.xml。<br>输入:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vim mapred-site.xml</div></pre></td></tr></table></figure></p>
<p>修改这个新建的mapred-site.xml文件，在<configuration>节点内加入配置:</configuration></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div></pre></td><td class="code"><pre><div class="line">&lt;property&gt;</div><div class="line">    &lt;name&gt;mapred.job.tracker&lt;/name&gt;</div><div class="line">    &lt;value&gt;master:9001&lt;/value&gt;</div><div class="line">&lt;/property&gt;</div><div class="line">&lt;property&gt;</div><div class="line">      &lt;name&gt;mapred.local.dir&lt;/name&gt;</div><div class="line">       &lt;value&gt;/root/hadoop/var&lt;/value&gt;</div><div class="line">&lt;/property&gt;</div><div class="line">&lt;property&gt;</div><div class="line">       &lt;name&gt;mapreduce.framework.name&lt;/name&gt;</div><div class="line">       &lt;value&gt;yarn&lt;/value&gt;</div><div class="line">&lt;/property&gt;</div></pre></td></tr></table></figure>
<h3 id="3，Hadoop启动"><a href="#3，Hadoop启动" class="headerlink" title="3，Hadoop启动"></a>3，Hadoop启动</h3><p>启动之前需要先格式化<br>切换到/home/hadoop/hadoop2.8/bin目录下<br>输入:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">./hadoop  namenode  -format</div></pre></td></tr></table></figure></p>
<p>格式化成功后，再切换到/home/hadoop/hadoop2.8/sbin目录下<br>启动hdfs和yarn<br>输入:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">start-dfs.sh</div><div class="line">start-yarn.sh</div></pre></td></tr></table></figure></p>
<p>启动成功后，输入jsp查看是否启动成功<br>在浏览器输入 ip+8088 和ip +50070 界面查看是否能访问<br>能正确访问则启动成功</p>
<h2 id="四、Mysql安装"><a href="#四、Mysql安装" class="headerlink" title="四、Mysql安装"></a>四、Mysql安装</h2><p>  因为Hive的默认元数据是Mysql，所以先要安装Mysql。<br>  Mysql有两种安装模式，可自行选择。</p>
<p>###1，yum安装<br>首先查看mysql 是否已经安装<br>输入：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">rpm -qa | grep mysql</div></pre></td></tr></table></figure></p>
<p>如果已经安装，想删除的话<br>输入:<br>普通删除命令:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">rpm -e mysql</div></pre></td></tr></table></figure></p>
<p>强力删除命令:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">rpm -e --nodeps mysql</div></pre></td></tr></table></figure></p>
<p> 依赖文件也会删除</p>
<p>安装mysql<br>输入:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">yum list mysql-server</div></pre></td></tr></table></figure></p>
<p>如果没有，则通过wget命令下载该包<br>输入:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm</div></pre></td></tr></table></figure></p>
<p>下载成功之后，再输入命令安装<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">yum install mysql-server</div></pre></td></tr></table></figure></p>
<p>在安装过程中遇到选择输入y就行了<br><img src="http://img.blog.csdn.net/20171216091314380?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"><br><img src="http://img.blog.csdn.net/20171216091322445?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>安装成功后，输入 service mysqld start  启动服务<br>输入:<br> mysqladmin -u root -p password ‘123456’<br>来设置密码<br>输入之后直接回车(默认是没有密码的)<br>然后再输入<br>mysql -u root -p<br><img src="http://img.blog.csdn.net/20171216091342560?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"><br>通过授权法更改远程连接权限<br>输入: grant all privileges on <em>.</em> to ‘root’@’%’ identified by ‘123456’;<br>注:第一个’root’是用户名,第二个’%’是所有的ip都可以远程访问,第三个’123456’表示 用户密码  如果不常用 就关闭掉<br>输入:flush privileges;  //刷新</p>
<p>在防火墙关闭之后，使用SQLYog之类的工具测试是否能正确连接</p>
<p><img src="http://img.blog.csdn.net/20171216091357000?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<h3 id="2，编译包安装"><a href="#2，编译包安装" class="headerlink" title="2，编译包安装"></a>2，编译包安装</h3><h4 id="Mysql文件准备"><a href="#Mysql文件准备" class="headerlink" title="Mysql文件准备"></a>Mysql文件准备</h4><p>将下载好的mysql安装包上传到linux服务器<br>解压mysql解压包，并移动到/usr/local目录下，重命名为mysql。<br>命令:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">tar -xvf mysql-5.6.21-linux-glibc2.5-x86_64.tar.gz</div><div class="line">mv mysql-5.6.21-linux-glibc2.5-x86_64 /usr/local</div><div class="line">cd /usr/local</div><div class="line">mv mysql-5.6.21-linux-glibc2.5-x86_64 mysql</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20171216091501845?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p><strong>注: mysql默认的路径是就是/usr/local/mysql ，如果安装的地方更改，需要更改相应的配置文件。</strong></p>
<h4 id="安装mysql"><a href="#安装mysql" class="headerlink" title="安装mysql"></a>安装mysql</h4><p>切换到mysql的目录 /usr/local/mysql<br>输入：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">./scripts/mysql_install_db --user=mysql</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20171216091540852?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"><br>成功安装mysql之后，输入<br>service mysql start  或  /etc/init.d/mysql start</p>
<p><img src="http://img.blog.csdn.net/20171216091605939?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"><br>查看是否启动成功<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">ps -ef|grep mysql</div></pre></td></tr></table></figure>
<p>切换到 /usr/local/mysql/bin 目录下<br>设置密码<br>mysqladmin -u root password ‘123456’入mysql<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">mysql -u root -p</div></pre></td></tr></table></figure>
<p>设置远程连接权限<br>输入:<br>grant all privileges on <em>.</em> to ‘root’@’%’ identified by ‘123456’;<br>然后输入:<br>flush privileges;</p>
<p>说明: 第一个’root’是用户名,第二个’%’是所有的ip都可以远程访问,第三个’123456’表示用户密码  如果不常用就关闭掉。</p>
<p>使用本地连接工具连接测试</p>
<p><img src="http://img.blog.csdn.net/20171216091707973?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<h2 id="五、Hive环境安装和配置"><a href="#五、Hive环境安装和配置" class="headerlink" title="五、Hive环境安装和配置"></a>五、Hive环境安装和配置</h2><h3 id="1，文件准备"><a href="#1，文件准备" class="headerlink" title="1，文件准备"></a>1，文件准备</h3><p>将下载下来的Hive 的配置文件进行解压<br>在linux上输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">tar -xvf  apache-hive-2.1.1-bin.tar.gz</div></pre></td></tr></table></figure>
<p>然后移动到/opt/hive 里面，将文件夹重命名为 hive2.1<br>输入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">mv  apache-hive-2.1.1-bin  /opt/hive</div><div class="line">mv apache-hive-2.1.1-bin hive2.1</div></pre></td></tr></table></figure>
<h3 id="2，环境配置"><a href="#2，环境配置" class="headerlink" title="2，环境配置"></a>2，环境配置</h3><p>编辑 /etc/profile 文件<br>输入:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vim /etc/profile</div></pre></td></tr></table></figure></p>
<p>添加:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">export HIVE_HOME=/opt/hive/hive2.1</div><div class="line">export HIVE_CONF_DIR=$&#123;HIVE_HOME&#125;/conf</div><div class="line">export PATH=.:$&#123;JAVA_HOME&#125;/bin:$&#123;SCALA_HOME&#125;/bin:$&#123;SPARK_HOME&#125;/bin:$&#123;HADOOP_HOME&#125;/bin:$&#123;ZK_HOME&#125;/bin:$&#123;HBASE_HOME&#125;/bin:$&#123;HIVE_HOME&#125;/bin:$PATH</div></pre></td></tr></table></figure></p>
<p><img src="http://img.blog.csdn.net/20171216091925239?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"><br><strong>注:实际配置以自己的为准！</strong><br>输入:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">source  /etc/profile</div></pre></td></tr></table></figure></p>
<p>使配置生效 </p>
<h3 id="3，配置更改"><a href="#3，配置更改" class="headerlink" title="3，配置更改"></a>3，配置更改</h3><h4 id="5-3-1新建文件夹"><a href="#5-3-1新建文件夹" class="headerlink" title="5.3.1新建文件夹"></a>5.3.1新建文件夹</h4><p>在修改配置文件之前，需要先在root目录下建立一些文件夹。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">mkdir /root/hive</div><div class="line">mkdir /root/hive/warehouse</div></pre></td></tr></table></figure>
<p>新建完该文件之后，需要让hadoop新建/root/hive/warehouse 和 /root/hive/ 目录。<br>执行命令：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">$HADOOP_HOME/bin/hadoop fs -mkdir -p /root/hive/</div><div class="line">$HADOOP_HOME/bin/hadoop fs -mkdir -p /root/hive/warehouse</div></pre></td></tr></table></figure>
<p>   给刚才新建的目录赋予读写权限，执行命令：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">$HADOOP_HOME/bin/hadoop fs -chmod 777 /root/hive/</div><div class="line">$HADOOP_HOME/bin/hadoop fs -chmod 777 /root/hive/warehouse</div></pre></td></tr></table></figure>
<p>检查这两个目录是否成功创建<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">$HADOOP_HOME/bin/hadoop fs -ls /root/</div><div class="line">$HADOOP_HOME/bin/hadoop fs -ls /root/hive/</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20171216092101563?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>可以看到已经成功创建</p>
<h4 id="5-3-2-修改hive-site-xml"><a href="#5-3-2-修改hive-site-xml" class="headerlink" title="5.3.2 修改hive-site.xml"></a>5.3.2 修改hive-site.xml</h4><p>切换到 /opt/hive/hive2.1/conf 目录下<br>将hive-default.xml.template 拷贝一份，并重命名为hive-site.xml<br>然后编辑hive-site.xml文件</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">cp hive-default.xml.template hive-site.xml</div><div class="line">vim hive-site.xml</div></pre></td></tr></table></figure>
<p>编辑hive-site.xml文件，在 <configuration> 中添加:</configuration></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div></pre></td><td class="code"><pre><div class="line">&lt;!-- 指定HDFS中的hive仓库地址 --&gt;  </div><div class="line">  &lt;property&gt;  </div><div class="line">    &lt;name&gt;hive.metastore.warehouse.dir&lt;/name&gt;  </div><div class="line">    &lt;value&gt;/root/hive/warehouse&lt;/value&gt;  </div><div class="line">  &lt;/property&gt;  </div><div class="line"></div><div class="line">&lt;property&gt;</div><div class="line">    &lt;name&gt;hive.exec.scratchdir&lt;/name&gt;</div><div class="line">    &lt;value&gt;/root/hive&lt;/value&gt;</div><div class="line">  &lt;/property&gt;</div><div class="line"></div><div class="line">  &lt;!-- 该属性为空表示嵌入模式或本地模式，否则为远程模式 --&gt;  </div><div class="line">  &lt;property&gt;  </div><div class="line">    &lt;name&gt;hive.metastore.uris&lt;/name&gt;  </div><div class="line">    &lt;value&gt;&lt;/value&gt;  </div><div class="line">  &lt;/property&gt;  </div><div class="line"></div><div class="line">&lt;!-- 指定mysql的连接 --&gt;</div><div class="line"> &lt;property&gt;</div><div class="line">        &lt;name&gt;javax.jdo.option.ConnectionURL&lt;/name&gt;</div><div class="line">        &lt;value&gt;jdbc:mysql://master:3306/hive?createDatabaseIfNotExist=true&lt;/value&gt;</div><div class="line">    &lt;/property&gt;</div><div class="line">&lt;!-- 指定驱动类 --&gt;</div><div class="line">    &lt;property&gt;</div><div class="line">        &lt;name&gt;javax.jdo.option.ConnectionDriverName&lt;/name&gt;</div><div class="line">        &lt;value&gt;com.mysql.jdbc.Driver&lt;/value&gt;</div><div class="line">    &lt;/property&gt;</div><div class="line">   &lt;!-- 指定用户名 --&gt;</div><div class="line">    &lt;property&gt;</div><div class="line">        &lt;name&gt;javax.jdo.option.ConnectionUserName&lt;/name&gt;</div><div class="line">        &lt;value&gt;root&lt;/value&gt;</div><div class="line">    &lt;/property&gt;</div><div class="line">    &lt;!-- 指定密码 --&gt;</div><div class="line">    &lt;property&gt;</div><div class="line">        &lt;name&gt;javax.jdo.option.ConnectionPassword&lt;/name&gt;</div><div class="line">        &lt;value&gt;123456&lt;/value&gt;</div><div class="line">    &lt;/property&gt;</div><div class="line">    &lt;property&gt;</div><div class="line">   &lt;name&gt;hive.metastore.schema.verification&lt;/name&gt;</div><div class="line">   &lt;value&gt;false&lt;/value&gt;</div><div class="line">    &lt;description&gt;</div><div class="line">    &lt;/description&gt;</div><div class="line"> &lt;/property&gt;</div></pre></td></tr></table></figure>
<p>然后将配置文件中所有的<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$&#123;system:java.io.tmpdir&#125;</div></pre></td></tr></table></figure></p>
<p> 更改为 /opt/hive/tmp  (如果没有该文件则创建)，<br>  并将此文件夹赋予读写权限，将<br> <figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$&#123;system:user.name&#125;</div></pre></td></tr></table></figure></p>
<p>   更改为 root</p>
<p>例如:<br>更改之前的:<br><img src="http://img.blog.csdn.net/20171216092323706?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"><br>更改之后:<br><img src="http://img.blog.csdn.net/20171216092332426?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>配置图:<br><img src="http://img.blog.csdn.net/20171216092358071?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p><strong>注: 由于hive-site.xml 文件中的配置过多，可以通过FTP将它下载下来进行编辑。也可以直接配置自己所需的，其他的可以删除。 MySQL的连接地址中的master是主机的别名，可以换成ip。</strong></p>
<h4 id="5-3-3-修改-hive-env-sh"><a href="#5-3-3-修改-hive-env-sh" class="headerlink" title="5.3.3 修改 hive-env.sh"></a>5.3.3 修改 hive-env.sh</h4><p>修改hive-env.sh 文件，没有就复制 hive-env.sh.template ，并重命名为hive-env.sh<br><img src="http://img.blog.csdn.net/20171216092503494?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"><br>在这个配置文件中添加</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">export  HADOOP_HOME=/opt/hadoop/hadoop2.8</div><div class="line">export  HIVE_CONF_DIR=/opt/hive/hive2.1/conf</div><div class="line">export  HIVE_AUX_JARS_PATH=/opt/hive/hive2.1/lib</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20171216092513103?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<h4 id="5-3-4-添加-数据驱动包"><a href="#5-3-4-添加-数据驱动包" class="headerlink" title="5.3.4 添加 数据驱动包"></a>5.3.4 添加 数据驱动包</h4><p>由于Hive 默认自带的数据库是使用mysql，所以这块就是用mysql<br>将mysql 的驱动包 上传到 /opt/hive/hive2.1/lib</p>
<p><img src="http://img.blog.csdn.net/20171216092521889?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<h2 id="六、Hive-Shell-测试"><a href="#六、Hive-Shell-测试" class="headerlink" title="六、Hive Shell 测试"></a>六、Hive Shell 测试</h2><p>在成功启动Hadoop之后<br>切换到Hive目录下<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">cd /opt/hive/hive2.1/bin</div></pre></td></tr></table></figure>
<p>首先初始化数据库<br>初始化的时候注意要将mysql启动<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">schematool  -initSchema -dbType mysql</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20171216092610984?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>执行成功之后，可以看到hive数据库和一堆表已经创建成功了</p>
<p><img src="http://img.blog.csdn.net/20171216092625312?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>切换到 cd  /opt/hive/hive2.1/bin<br>进入hive (确保hadoop以及成功启动)<br>输入: </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hive</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20171216092640698?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>进入hive 之后<br>做一些简单的操作<br>新建一个库，然后在建一张表<br>基本操作和普通的关系型数据库差不多<br>创建库:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">create database db_hiveTest;</div></pre></td></tr></table></figure>
<p>创建表:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">create  table  db_hiveTest.student(id int,name string)  row  format  delimited  fields   terminated  by  &apos;\t&apos;;</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20171216092739971?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p><strong>说明:  terminated  by  ‘\t’ 表示文本分隔符要使用Tab，行与行直接不能有空格。</strong></p>
<p><strong>加载数据</strong><br>新打开一个窗口<br>因为hive 不支持写，所以添加数据使用load加载文本获取。<br>新建一个文本</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">touch  /opt/hive/student.txt</div></pre></td></tr></table></figure>
<p>编辑该文本添加数据<br>输入:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vim /opt/hive/student.txt</div></pre></td></tr></table></figure></p>
<p>添加数据:<br>中间的空格符使用Tab建<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">1001    zhangsan</div><div class="line">1002    lisi</div><div class="line">1003    wangwu</div></pre></td></tr></table></figure></p>
<p><img src="http://img.blog.csdn.net/20171216092911542?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"><br><strong>说明: 文本可以在Windows上面新建，然后通过ftp上传到linux中，需要注意文本的格式为unix 格式。</strong></p>
<p>切换到hive shell<br>加载数据<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">load data local inpath &apos;/opt/hive/student.txt&apos;  into table db_hivetest.student;</div></pre></td></tr></table></figure>
<p>然后查询该数据<br>输入：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">select * from db_hiveTest.student;</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20171216092924498?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>本文的Hadoop+Hive的配置就到此结束了，谢谢阅读！</p>
<h2 id="其它"><a href="#其它" class="headerlink" title="其它"></a>其它</h2><p>更多的hive使用请参考官方文档<br><a href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual" target="_blank" rel="external">https://cwiki.apache.org/confluence/display/Hive/LanguageManual</a><br>环境搭建参考:<br><a href="http://blog.csdn.net/pucao_cug/article/details/71773665" target="_blank" rel="external">http://blog.csdn.net/pucao_cug/article/details/71773665</a></p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>
     
    <div>
	 +
	  
<div style="text-align:center;color: #ccc;font-size:14px;">
------ 本文结束 ------</div>
<br/>
<div style="border: 1px solid black">
<div style="margin-left:10px">
<span style="font-weight:blod">版权声明</span>
<!-- <img src="/images/xuwujing.png" > -->
<br/>
<p style="font-size: 10px;line-height: 30px"><a href="http://www.panchengming.com/" style="color:#258FC6">xuwujing's Notes</a> by <a href="http://www.panchengming.com/" style="color:#258FC6">ChengMing Pan</a> is licensed under a <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/" style="color:#258FC6">Creative Commons BY-NC-ND 4.0 International License</a>.<br/>
由<a href="http://www.panchengming.com/" style="color:#258FC6">虚无境</a>创作并维护的<a href="http://www.panchengming.com/" style="color:#258FC6">xuwujing's Notes</a>博客采用<a href="https://creativecommons.org/licenses/by-nc-nd/4.0/" style="color:#258FC6">创作共用保留署名-非商业-禁止演绎4.0国际许可证</a>。<br/>
本文首发于<a href="http://www.panchengming.com/" style="color:#258FC6">xuwujing's Notes</a> 博客（ <a href="http://www.panchengming.com/" style="color:#258FC6">http://www.panchengming.com/</a> ），版权所有，侵权必究。</p>
</div>
</div>

	
	</div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/大数据/" rel="tag"># 大数据</a>
          
            <a href="/tags/hive/" rel="tag"># hive</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/12/15/pancm60/" rel="next" title="使用VMware安装linux虚拟机以及相关配置">
                <i class="fa fa-chevron-left"></i> 使用VMware安装linux虚拟机以及相关配置
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/12/18/pancm62/" rel="prev" title="大数据学习系列之五 ----- Hive整合HBase图文详解">
                大数据学习系列之五 ----- Hive整合HBase图文详解 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/xuwujing.png"
               alt="虚无境" />
          <p class="site-author-name" itemprop="name">虚无境</p>
           
              <p class="site-description motion-element" itemprop="description">The way of the future!</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives/">
                <span class="site-state-item-count">136</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">30</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">59</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/xuwujing" target="_blank" title="github">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                  github
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://blog.csdn.net/qazwsxpcm?viewmode=list" target="_blank" title="csdn">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                  csdn
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://home.cnblogs.com/u/xuwujing/" target="_blank" title="cnblogs">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                  cnblogs
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.woainia.site/" title="woainia" target="_blank">woainia</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://cmsblogs.com/" title="chenssy" target="_blank">chenssy</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://italker.imisty.cn" title="xiaowu" target="_blank">xiaowu</a>
                </li>
              
            </ul>
          </div>
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#引言"><span class="nav-number">1.</span> <span class="nav-text">引言</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#一、环境准备"><span class="nav-number">2.</span> <span class="nav-text">一、环境准备</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1，服务器选择"><span class="nav-number">2.1.</span> <span class="nav-text">1，服务器选择</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2，配置选择"><span class="nav-number">2.2.</span> <span class="nav-text">2，配置选择</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3，下载地址"><span class="nav-number">2.3.</span> <span class="nav-text">3，下载地址</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#二、服务器的相关配置"><span class="nav-number">3.</span> <span class="nav-text">二、服务器的相关配置</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1，更改主机名"><span class="nav-number">3.1.</span> <span class="nav-text">1，更改主机名</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2，做IP和主机名的映射"><span class="nav-number">3.2.</span> <span class="nav-text">2，做IP和主机名的映射</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3，关闭防火墙"><span class="nav-number">3.3.</span> <span class="nav-text">3，关闭防火墙</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3，时间设置"><span class="nav-number">3.4.</span> <span class="nav-text">3，时间设置</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#三、Hadoop安装和配置"><span class="nav-number">4.</span> <span class="nav-text">三、Hadoop安装和配置</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1，环境变量设置"><span class="nav-number">4.1.</span> <span class="nav-text">1，环境变量设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2，配置文件更改"><span class="nav-number">4.2.</span> <span class="nav-text">2，配置文件更改</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#3-2-1-修改-core-site-xml"><span class="nav-number">4.2.1.</span> <span class="nav-text">3.2.1 修改 core-site.xml</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-2修改-hadoop-env-sh"><span class="nav-number">4.3.</span> <span class="nav-text">3.2.2修改 hadoop-env.sh</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-3修改-hdfs-site-xml"><span class="nav-number">4.4.</span> <span class="nav-text">3.2.3修改 hdfs-site.xml</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-4-修改mapred-site-xml"><span class="nav-number">4.5.</span> <span class="nav-text">3.2.4 修改mapred-site.xml</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3，Hadoop启动"><span class="nav-number">4.6.</span> <span class="nav-text">3，Hadoop启动</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#四、Mysql安装"><span class="nav-number">5.</span> <span class="nav-text">四、Mysql安装</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#2，编译包安装"><span class="nav-number">5.1.</span> <span class="nav-text">2，编译包安装</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Mysql文件准备"><span class="nav-number">5.1.1.</span> <span class="nav-text">Mysql文件准备</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#安装mysql"><span class="nav-number">5.1.2.</span> <span class="nav-text">安装mysql</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#五、Hive环境安装和配置"><span class="nav-number">6.</span> <span class="nav-text">五、Hive环境安装和配置</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1，文件准备"><span class="nav-number">6.1.</span> <span class="nav-text">1，文件准备</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2，环境配置"><span class="nav-number">6.2.</span> <span class="nav-text">2，环境配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3，配置更改"><span class="nav-number">6.3.</span> <span class="nav-text">3，配置更改</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#5-3-1新建文件夹"><span class="nav-number">6.3.1.</span> <span class="nav-text">5.3.1新建文件夹</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#5-3-2-修改hive-site-xml"><span class="nav-number">6.3.2.</span> <span class="nav-text">5.3.2 修改hive-site.xml</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#5-3-3-修改-hive-env-sh"><span class="nav-number">6.3.3.</span> <span class="nav-text">5.3.3 修改 hive-env.sh</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#5-3-4-添加-数据驱动包"><span class="nav-number">6.3.4.</span> <span class="nav-text">5.3.4 添加 数据驱动包</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#六、Hive-Shell-测试"><span class="nav-number">7.</span> <span class="nav-text">六、Hive Shell 测试</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#其它"><span class="nav-number">8.</span> <span class="nav-text">其它</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">虚无境</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Pisces
  </a>
</div>

  <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js">
</script>
 | 
本站总访问量<span id="busuanzi_value_site_pv"></span>次
 | 
本站访客数<span id="busuanzi_value_site_uv"></span>人次
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=857896&auto=0&height=66"></iframe>



        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.1"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>



  


  




	





  





  





  






  





  

  

  

  

  

  

</body>
</html>
